package com.aaa.day1104.demo02;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @author ${崔灿}
 * @date 2022/11/04 17:22
 **/

public class Test05 {
    public static void main(String[] args) {
//        Function<String,Doctor> function = (t)->new Doctor(t);
        //Function<String, Doctor> function2 =Doctor::new;

        //Supplier<Doctor> supplier1=()->new Doctor();
        Supplier<Doctor> supplier = Doctor::new;
        System.out.println(supplier.get());
//        Doctor doctor =function.apply("刘德华");
//        System.out.println(doctor);
    }
}
class Doctor{
    private String name;

    public Doctor() {
    }

    public Doctor(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Doctor{" +
                "name='" + name + '\'' +
                '}';
    }
}

